Skip to content

Support SSL certificate verification option when creating httpx AsyncClient #1280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ruhz3
Copy link

@ruhz3 ruhz3 commented Aug 18, 2025

Added support for the verify option to the create_mcp_http_client function and related client factories, allowing users to control SSL certificate verification when creating an httpx AsyncClient.

Motivation and Context

Some users need to disable SSL verification (e.g., for testing or internal endpoints), or use a custom CA bundle. This change makes it possible to pass verify=True, verify=False, or a custom ssl.SSLContext when creating MCP HTTP clients.

How Has This Been Tested?

Tested by creating AsyncClient instances with different verify values (True, False, and custom context) and confirming correct behavior for secure and insecure endpoints. Existing unit tests for HTTP client creation were also run.

Breaking Changes

No breaking changes. The new verify parameter is optional and defaults to the previous behavior.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

This change improves flexibility for users working in environments with custom or self-signed certificates, or those who need to disable SSL verification for

resolves #870
This PR does not fully resolve the linked issue, but it applies the necessary modifications to the current repository. Further functional modifications following this PR are needed in the fastmcp repository.

@ruhz3 ruhz3 requested a review from a team as a code owner August 18, 2025 13:39
@ruhz3 ruhz3 requested a review from dsp-ant August 18, 2025 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add SSL Certificate Verification Options to FastMCP Client
1 participant